<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/api.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<title>SortableCGridView</title>
</head>

<body>
<div id="apiPage">

<div id="apiHeader">
<a href="http://www.yiiframework.com/extension/yiisortablemodel/">Yii Sortable Model</a> Class Reference. <a href="http://www.yiiframework.com">Yii Framework</a>
</div><!-- end of header -->

<div id="content">
<h1>SortableCGridView</h1>
<div id="nav">
<a href="index.html">All Packages</a>
| <a href="#properties">Properties</a>
| <a href="#methods">Methods</a>
</div>

<table class="summaryTable docClass">
<colgroup>
	<col class="col-name" />
	<col class="col-value" />
</colgroup>
<tr>
  <th>Package</th>
  <td><a href="index.html#Yii Sortable Model">Yii Sortable Model</a></td>
</tr>
<tr>
  <th>Inheritance</th>
  <td>class SortableCGridView &raquo;
<a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a> &raquo;
<a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a> &raquo;
<a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a> &raquo;
<a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a> &raquo;
<a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr>
  <th>Since</th>
  <td>1.0</td>
</tr>
<tr>
  <th>Source Code</th>
  <td><a class="sourceLink" href="https://github.com/laMarciana/yiiSortableModel/blob/master/widgets/SortableCGridView.php">extensions//widgets/SortableCGridView.php</a></td>
</tr>
</table>

<div id="classDescription">
CGridView widget extended to allow drag and drop sorting of records. With it, users will be able to drag and drop with the mouse the rows of the grid to change records order. New order will be automatically saved in the database through an Ajax call.</div>

<a name="properties"></a>

<div class="summary docProperty">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="actionPrefix">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#actionPrefix-detail">actionPrefix</a></td>
  <td>string</td>
  <td>the prefix to the IDs of the <a href="SortableCGridView.html#actions">actions</a>.</td>
  <td>CWidget</td>
</tr>
<tr class="inherited" id="afterAjaxUpdate">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#afterAjaxUpdate-detail">afterAjaxUpdate</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked after a successful AJAX response is received.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="ajaxUpdate">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#ajaxUpdate-detail">ajaxUpdate</a></td>
  <td>mixed</td>
  <td>the ID of the container whose content may be updated with an AJAX response.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="ajaxUpdateError">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#ajaxUpdateError-detail">ajaxUpdateError</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked if an AJAX update error occurs.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="ajaxUrl">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#ajaxUrl-detail">ajaxUrl</a></td>
  <td>mixed</td>
  <td>the URL for the AJAX requests should be sent to.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="ajaxVar">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#ajaxVar-detail">ajaxVar</a></td>
  <td>string</td>
  <td>the name of the GET variable that indicates the request is an AJAX request triggered
by this widget.</td>
  <td>CGridView</td>
</tr>
<tr id="allItemsInOnePage">
  <td><a href="SortableCGridView.html#allItemsInOnePage-detail">allItemsInOnePage</a></td>
  <td>boolean</td>
  <td>whether to show all items in one page, disabling completely pagination.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="baseScriptUrl">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#baseScriptUrl-detail">baseScriptUrl</a></td>
  <td>string</td>
  <td>the base script URL for all grid view resources (e.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="beforeAjaxUpdate">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#beforeAjaxUpdate-detail">beforeAjaxUpdate</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked before an AJAX update occurs.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="blankDisplay">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#blankDisplay-detail">blankDisplay</a></td>
  <td>string</td>
  <td>the text to be displayed in an empty grid cell.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="columns">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#columns-detail">columns</a></td>
  <td>array</td>
  <td>grid column configuration.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="controller">
  <td>controller</td>
  <td>CController</td>
  <td>Returns the controller that this widget belongs to.</td>
  <td>CWidget</td>
</tr>
<tr class="inherited" id="cssFile">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#cssFile-detail">cssFile</a></td>
  <td>string</td>
  <td>the URL of the CSS file used by this grid view.</td>
  <td>CGridView</td>
</tr>
<tr id="dataProvider">
  <td><a href="SortableCGridView.html#dataProvider-detail">dataProvider</a></td>
  <td>CActiveDataProvider</td>
  <td>the data provider for the view.</td>
  <td>SortableCGridView</td>
</tr>
<tr id="descSort">
  <td><a href="SortableCGridView.html#descSort-detail">descSort</a></td>
  <td>boolean</td>
  <td>whether to show records in a descendant order.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="emptyText">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#emptyText-detail">emptyText</a></td>
  <td>string</td>
  <td>the message to be displayed when <a href="SortableCGridView.html#dataProvider">dataProvider</a> does not have any data.</td>
  <td>CBaseListView</td>
</tr>
<tr id="enableDragDropSorting">
  <td><a href="SortableCGridView.html#enableDragDropSorting-detail">enableDragDropSorting</a></td>
  <td>boolean</td>
  <td>whether to enable the drag and drop sorting, which is the essence of this widget.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="enablePagination">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#enablePagination-detail">enablePagination</a></td>
  <td>boolean</td>
  <td>whether to enable pagination.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="enableSorting">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#enableSorting-detail">enableSorting</a></td>
  <td>boolean</td>
  <td>whether to enable sorting.</td>
  <td>CBaseListView</td>
</tr>
<tr id="errorMessage">
  <td><a href="SortableCGridView.html#errorMessage-detail">errorMessage</a></td>
  <td>string</td>
  <td>a message to show when there is an error in drag and drop sorting.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="filter">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#filter-detail">filter</a></td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CModel">CModel</a></td>
  <td>the model instance that keeps the user-entered filter data.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="filterCssClass">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#filterCssClass-detail">filterCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the table row element containing all filter input fields.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="filterPosition">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#filterPosition-detail">filterPosition</a></td>
  <td>string</td>
  <td>whether the filters should be displayed in the grid view.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="formatter">
  <td>formatter</td>
  <td>CFormatter</td>
  <td>the formatter instance.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="hasFooter">
  <td>hasFooter</td>
  <td>boolean</td>
  <td>whether the table should render a footer.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="hideHeader">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#hideHeader-detail">hideHeader</a></td>
  <td>boolean</td>
  <td>whether to hide the header cells of the grid.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="htmlOptions">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#htmlOptions-detail">htmlOptions</a></td>
  <td>array</td>
  <td>the HTML options for the view container tag.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="id">
  <td>id</td>
  <td>string</td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td>CWidget</td>
</tr>
<tr id="idField">
  <td><a href="SortableCGridView.html#idField-detail">idField</a></td>
  <td>string</td>
  <td>the field name in the database table which stores the id for the record.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="itemsCssClass">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#itemsCssClass-detail">itemsCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the container of all data item display.</td>
  <td>CBaseListView</td>
</tr>
<tr id="jqueryUiSortableOptions">
  <td><a href="SortableCGridView.html#jqueryUiSortableOptions-detail">jqueryUiSortableOptions</a></td>
  <td>array</td>
  <td>options passed to initialize Jquery Ui Sortable.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="loadingCssClass">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#loadingCssClass-detail">loadingCssClass</a></td>
  <td>string</td>
  <td>the CSS class name that will be assigned to the widget container element
when the widget is updating its content via AJAX.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="nullDisplay">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#nullDisplay-detail">nullDisplay</a></td>
  <td>string</td>
  <td>the text to be displayed in a data cell when a data value is null.</td>
  <td>CGridView</td>
</tr>
<tr id="orderField">
  <td><a href="SortableCGridView.html#orderField-detail">orderField</a></td>
  <td>string</td>
  <td>the field name in the database table which stores the order for the record.</td>
  <td>SortableCGridView</td>
</tr>
<tr id="orderUrl">
  <td><a href="SortableCGridView.html#orderUrl-detail">orderUrl</a></td>
  <td>string</td>
  <td>the action name that will be used to trigger drag and drop sorting (through the AjaxSortingAction located in the "actions" directory in this extension).</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="owner">
  <td>owner</td>
  <td>CBaseController</td>
  <td>Returns the owner/creator of this widget.</td>
  <td>CWidget</td>
</tr>
<tr class="inherited" id="pager">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#pager-detail">pager</a></td>
  <td>array</td>
  <td>the configuration for the pager.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="pagerCssClass">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#pagerCssClass-detail">pagerCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the pager container.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="rowCssClass">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#rowCssClass-detail">rowCssClass</a></td>
  <td>array</td>
  <td>the CSS class names for the table body rows.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="rowCssClassExpression">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#rowCssClassExpression-detail">rowCssClassExpression</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every table body row and whose result
is used as the CSS class name for the row.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="selectableRows">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#selectableRows-detail">selectableRows</a></td>
  <td>integer</td>
  <td>the number of table body rows that can be selected.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="selectionChanged">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#selectionChanged-detail">selectionChanged</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked after the row selection is changed.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="showTableOnEmpty">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#showTableOnEmpty-detail">showTableOnEmpty</a></td>
  <td>boolean</td>
  <td>whether to display the table even when there is no data.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="skin">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#skin-detail">skin</a></td>
  <td>mixed</td>
  <td>the name of the skin to be used by this widget.</td>
  <td>CWidget</td>
</tr>
<tr id="successMessage">
  <td><a href="SortableCGridView.html#successMessage-detail">successMessage</a></td>
  <td>string</td>
  <td>a message to show when drag and drop sorting is completed successfully.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="summaryCssClass">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#summaryCssClass-detail">summaryCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the summary text container.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="summaryText">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#summaryText-detail">summaryText</a></td>
  <td>string</td>
  <td>the summary text template for the view.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="tagName">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#tagName-detail">tagName</a></td>
  <td>string</td>
  <td>the tag name for the view container.</td>
  <td>CBaseListView</td>
</tr>
<tr class="inherited" id="template">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#template-detail">template</a></td>
  <td>string</td>
  <td>the template to be used to control the layout of various sections in the view.</td>
  <td>CBaseListView</td>
</tr>
<tr id="updateAfterSorting">
  <td><a href="SortableCGridView.html#updateAfterSorting-detail">updateAfterSorting</a></td>
  <td>boolean</td>
  <td>whether to update grid content after sorting.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="updateSelector">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#updateSelector-detail">updateSelector</a></td>
  <td>string</td>
  <td>the jQuery selector of the HTML elements that may trigger AJAX updates when they are clicked.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="viewPath">
  <td>viewPath</td>
  <td>string</td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td>CWidget</td>
</tr>
</table>
</div>

<div class="summary docProperty">
<h2>Protected Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="sortScript">
  <td><a href="SortableCGridView.html#sortScript-detail">sortScript</a></td>
  <td>string</td>
  <td>Returns the javascript code responsable of handling the drag and drop sorting through an Ajax request</td>
  <td>SortableCGridView</td>
</tr>
</table>
</div>

<a name="methods"></a>

<div class="summary docMethod">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="__call">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#__call-detail">__call()</a></td>
  <td>Calls the named method which is not a class method.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="__construct">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#__construct-detail">__construct()</a></td>
  <td>Constructor.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="__get">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#__get-detail">__get()</a></td>
  <td>Returns a property value, an event handler list or a behavior based on its name.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="__isset">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#__isset-detail">__isset()</a></td>
  <td>Checks if a property value is null.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="__set">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#__set-detail">__set()</a></td>
  <td>Sets value of a component property.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="__unset">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#__unset-detail">__unset()</a></td>
  <td>Sets a component property to be null.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="actions">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#actions-detail">actions()</a></td>
  <td>Returns a list of actions that are used by this widget.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="asa">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#asa-detail">asa()</a></td>
  <td>Returns the named behavior object.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehavior">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#attachBehavior-detail">attachBehavior()</a></td>
  <td>Attaches a behavior to this component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehaviors">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#attachBehaviors-detail">attachBehaviors()</a></td>
  <td>Attaches a list of behaviors to the component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="attachEventHandler">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#attachEventHandler-detail">attachEventHandler()</a></td>
  <td>Attaches an event handler to an event.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="beginCache">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#beginCache-detail">beginCache()</a></td>
  <td>Begins fragment caching.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginClip">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#beginClip-detail">beginClip()</a></td>
  <td>Begins recording a clip.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginContent">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#beginContent-detail">beginContent()</a></td>
  <td>Begins the rendering of content that is to be decorated by the specified view.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginWidget">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#beginWidget-detail">beginWidget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="canGetProperty">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#canGetProperty-detail">canGetProperty()</a></td>
  <td>Determines whether a property can be read.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="canSetProperty">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#canSetProperty-detail">canSetProperty()</a></td>
  <td>Determines whether a property can be set.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="createWidget">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#createWidget-detail">createWidget()</a></td>
  <td>Creates a widget and initializes it.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="detachBehavior">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#detachBehavior-detail">detachBehavior()</a></td>
  <td>Detaches a behavior from the component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="detachBehaviors">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#detachBehaviors-detail">detachBehaviors()</a></td>
  <td>Detaches all behaviors from the component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="detachEventHandler">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#detachEventHandler-detail">detachEventHandler()</a></td>
  <td>Detaches an existing event handler.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehavior">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#disableBehavior-detail">disableBehavior()</a></td>
  <td>Disables an attached behavior.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehaviors">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#disableBehaviors-detail">disableBehaviors()</a></td>
  <td>Disables all behaviors attached to this component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehavior">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#enableBehavior-detail">enableBehavior()</a></td>
  <td>Enables an attached behavior.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehaviors">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#enableBehaviors-detail">enableBehaviors()</a></td>
  <td>Enables all behaviors attached to this component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="endCache">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#endCache-detail">endCache()</a></td>
  <td>Ends fragment caching.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="endClip">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#endClip-detail">endClip()</a></td>
  <td>Ends recording a clip.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="endContent">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#endContent-detail">endContent()</a></td>
  <td>Ends the rendering of content.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="endWidget">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#endWidget-detail">endWidget()</a></td>
  <td>Ends the execution of the named widget.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="evaluateExpression">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#evaluateExpression-detail">evaluateExpression()</a></td>
  <td>Evaluates a PHP expression or callback under the context of this component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="getController">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#getController-detail">getController()</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="getEventHandlers">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#getEventHandlers-detail">getEventHandlers()</a></td>
  <td>Returns the list of attached event handlers for an event.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="getFormatter">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#getFormatter-detail">getFormatter()</a></td>
  <td>Returns the formatter instance. Defaults to the 'format' application component.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="getHasFooter">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#getHasFooter-detail">getHasFooter()</a></td>
  <td>Returns whether the table should render a footer.
This is true if any of the <a href="SortableCGridView.html#columns">columns</a> has a true CGridColumn::hasFooter value.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="getId">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#getId-detail">getId()</a></td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="getOwner">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#getOwner-detail">getOwner()</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewFile">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#getViewFile-detail">getViewFile()</a></td>
  <td>Looks for the view script file according to the view name.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewPath">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#getViewPath-detail">getViewPath()</a></td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="hasEvent">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#hasEvent-detail">hasEvent()</a></td>
  <td>Determines whether an event is defined.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="hasEventHandler">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#hasEventHandler-detail">hasEventHandler()</a></td>
  <td>Checks whether the named event has attached handlers.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr class="inherited" id="hasProperty">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#hasProperty-detail">hasProperty()</a></td>
  <td>Determines whether a property is defined.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr id="init">
  <td><a href="SortableCGridView.html#init-detail">init()</a></td>
  <td>Initializes the grid view.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="raiseEvent">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent/#raiseEvent-detail">raiseEvent()</a></td>
  <td>Raises an event.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a></td>
</tr>
<tr id="registerClientScript">
  <td><a href="SortableCGridView.html#registerClientScript-detail">registerClientScript()</a></td>
  <td>Registers necessary client scripts.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="render">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#render-detail">render()</a></td>
  <td>Renders a view.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="renderContent">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#renderContent-detail">renderContent()</a></td>
  <td>Renders the main content of the view.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderEmptyText">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#renderEmptyText-detail">renderEmptyText()</a></td>
  <td>Renders the empty message when there is no data.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderFile">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#renderFile-detail">renderFile()</a></td>
  <td>Renders a view file.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="renderFilter">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#renderFilter-detail">renderFilter()</a></td>
  <td>Renders the filter.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="renderInternal">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#renderInternal-detail">renderInternal()</a></td>
  <td>Renders a view file.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
<tr class="inherited" id="renderItems">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#renderItems-detail">renderItems()</a></td>
  <td>Renders the data items for the grid view.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="renderKeys">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#renderKeys-detail">renderKeys()</a></td>
  <td>Renders the key values of the data in a hidden tag.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderPager">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#renderPager-detail">renderPager()</a></td>
  <td>Renders the pager.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderSummary">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#renderSummary-detail">renderSummary()</a></td>
  <td>Renders the summary text.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderTableBody">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#renderTableBody-detail">renderTableBody()</a></td>
  <td>Renders the table body.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="renderTableFooter">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#renderTableFooter-detail">renderTableFooter()</a></td>
  <td>Renders the table footer.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="renderTableHeader">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#renderTableHeader-detail">renderTableHeader()</a></td>
  <td>Renders the table header.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr id="renderTableRow">
  <td><a href="SortableCGridView.html#renderTableRow-detail">renderTableRow()</a></td>
  <td>Renders a table body row.</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="run">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#run-detail">run()</a></td>
  <td>Renders the view.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
<tr class="inherited" id="setFormatter">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#setFormatter-detail">setFormatter()</a></td>
  <td>Sets the formatter instance</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="setId">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget/#setId-detail">setId()</a></td>
  <td>Sets the ID of the widget.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CWidget">CWidget</a></td>
</tr>
<tr class="inherited" id="widget">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController/#widget-detail">widget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseController">CBaseController</a></td>
</tr>
</table>
</div>

<div class="summary docMethod">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="createDataColumn">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#createDataColumn-detail">createDataColumn()</a></td>
  <td>Creates a CDataColumn based on a shortcut column specification string.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr id="getSortScript">
  <td><a href="SortableCGridView.html#getSortScript-detail">getSortScript()</a></td>
  <td>Returns the javascript code responsable of handling the drag and drop sorting through an Ajax request</td>
  <td>SortableCGridView</td>
</tr>
<tr class="inherited" id="initColumns">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView/#initColumns-detail">initColumns()</a></td>
  <td>Creates column objects and initializes them.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CGridView">CGridView</a></td>
</tr>
<tr class="inherited" id="renderSection">
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView/#renderSection-detail">renderSection()</a></td>
  <td>Renders a section.</td>
  <td><a href="http://www.yiiframework.com/doc/api/1.1/CBaseListView">CBaseListView</a></td>
</tr>
</table>
</div>

<a name="events"></a>

<h2>Property Details</h2>
<div class="detailHeader" id="allItemsInOnePage-detail">
allItemsInOnePage<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$allItemsInOnePage</b>;</div>

<p>whether to show all items in one page, disabling completely pagination. Defaults to true</p>


<div class="detailHeader" id="dataProvider-detail">
dataProvider<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public CActiveDataProvider <b>$dataProvider</b>;</div>

<p>the data provider for the view.</p>


<div class="detailHeader" id="descSort-detail">
descSort<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$descSort</b>;</div>

<p>whether to show records in a descendant order. Defaults to false</p>


<div class="detailHeader" id="enableDragDropSorting-detail">
enableDragDropSorting<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$enableDragDropSorting</b>;</div>

<p>whether to enable the drag and drop sorting, which is the essence of this widget. If it's set to true sorting by clicking in columns names is disabled (so $enableSorting property has no effect) and items are showed ordered by the field defined in $orderField. If it's set to false, the widget defaults to a normal CGridView and the rest of this extension widget properties are ignored. Defaults to true</p>


<div class="detailHeader" id="errorMessage-detail">
errorMessage<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$errorMessage</b>;</div>

<p>a message to show when there is an error in drag and drop sorting. Defaults to 'An error has occured while sorting'</p>


<div class="detailHeader" id="idField-detail">
idField<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$idField</b>;</div>

<p>the field name in the database table which stores the id for the record. Defaults to 'id'</p>


<div class="detailHeader" id="jqueryUiSortableOptions-detail">
jqueryUiSortableOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$jqueryUiSortableOptions</b>;</div>

<p>options passed to initialize Jquery Ui Sortable. Look at http://jqueryui.com/demos/sortable/ for the available options. Keys must be options name and values options values</p>


<div class="detailHeader" id="orderField-detail">
orderField<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$orderField</b>;</div>

<p>the field name in the database table which stores the order for the record. This should be a positive integer field. Defaults to 'order'</p>


<div class="detailHeader" id="orderUrl-detail">
orderUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$orderUrl</b>;</div>

<p>the action name that will be used to trigger drag and drop sorting (through the AjaxSortingAction located in the "actions" directory in this extension). Defaults to 'order'. This must be defined in the "actions" method of the controller in which this widget is called. For example: "public function actions() {return array('order' => array('class' => 'ext.yiisortablemodel.actions.AjaxSortingAction'))}. If needed, its acces rules have to be defined, too"</p>


<div class="detailHeader" id="sortScript-detail">
sortScript<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
protected string <a href="SortableCGridView.html#getSortScript"><b>getSortScript</b></a>()</div>

<p>Returns the javascript code responsable of handling the drag and drop sorting through an Ajax request</p>


<div class="detailHeader" id="successMessage-detail">
successMessage<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$successMessage</b>;</div>

<p>a message to show when drag and drop sorting is completed successfully. If it's an empty string, no message is showed. Defaults to empty string</p>


<div class="detailHeader" id="updateAfterSorting-detail">
updateAfterSorting<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$updateAfterSorting</b>;</div>

<p>whether to update grid content after sorting. Useful to update rows classes which depends on row positions, as during sorting they have been changed. Defaults to true</p>


<h2>Method Details</h2>

<div class="detailHeader" id="getSortScript-detail">
getSortScript()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected string <b>getSortScript</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">drag and drop sorting javascript code</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/laMarciana/yiiSortableModel/blob/master/widgets/SortableCGridView.php#L132">extensions//widgets/SortableCGridView.php#L132</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">getSortScript</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;return&nbsp;</span><span style="color: #DD0000">'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;grid_id&nbsp;=&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">Cjavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">()).</span><span style="color: #DD0000">';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;grid_selector&nbsp;=&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">Cjavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #DD0000">'#'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">()).</span><span style="color: #DD0000">';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;tbody_selector&nbsp;=&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">Cjavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #DD0000">'#'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">().</span><span style="color: #DD0000">'&nbsp;tbody'</span><span style="color: #007700">).</span><span style="color: #DD0000">';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*apply&nbsp;sortable*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(tbody_selector).sortable('</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">jqueryUiSortableOptions</span><span style="color: #007700">).</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*helper&nbsp;to&nbsp;keep&nbsp;each&nbsp;table&nbsp;cell&nbsp;width&nbsp;while&nbsp;dragging*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(tbody_selector).sortable("option",&nbsp;"helper",&nbsp;function(e,&nbsp;ui)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ui.children().each(function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).width($(this).width());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;ui;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*add&nbsp;dragged&nbsp;row&nbsp;index&nbsp;before&nbsp;moving&nbsp;as&nbsp;an&nbsp;attribute.&nbsp;Used&nbsp;to&nbsp;know&nbsp;if&nbsp;item&nbsp;is&nbsp;moved&nbsp;forward&nbsp;or&nbsp;backward*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(tbody_selector).bind("sortstart",&nbsp;function(event,&nbsp;ui)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ui.item.attr("data-prev-index",&nbsp;ui.item.index());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*trigger&nbsp;ajax&nbsp;sorting&nbsp;when&nbsp;grid&nbsp;is&nbsp;updated*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(tbody_selector).bind("sortupdate",&nbsp;function(event,&nbsp;ui)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(grid_selector).addClass('</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">loadingCssClass</span><span style="color: #007700">).</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;data&nbsp;=&nbsp;{};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data["dragged_item_id"]&nbsp;=&nbsp;parseInt(ui.item.attr("data-id"));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;prev_index&nbsp;=&nbsp;parseInt(ui.item.attr("data-prev-index"));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;new_index&nbsp;=&nbsp;parseInt(ui.item.index());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*which&nbsp;item&nbsp;place&nbsp;take&nbsp;dragged&nbsp;item*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(prev_index&nbsp;&lt;&nbsp;new_index)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data["replacement_item_id"]&nbsp;=&nbsp;ui.item.prev().attr("data-id");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data["replacement_item_id"]&nbsp;=&nbsp;ui.item.next().attr("data-id");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data["model"]&nbsp;=&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">Cjavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">modelClass</span><span style="color: #007700">).</span><span style="color: #DD0000">';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data["order_field"]&nbsp;=&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">Cjavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">orderField</span><span style="color: #007700">).</span><span style="color: #DD0000">';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ui.item.removeAttr("data-prev-index");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">ajax</span><span style="color: #007700">(array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'type'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'POST'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'url'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">App</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">controller</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">createAbsoluteUrl</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">orderUrl</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'data'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'js:data'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'success'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'js:function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(grid_selector).removeClass('</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">loadingCssClass</span><span style="color: #007700">).</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*update&nbsp;the&nbsp;whole&nbsp;grid&nbsp;again&nbsp;to&nbsp;update&nbsp;row&nbsp;class&nbsp;values*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;("'</span><span style="color: #007700">.(string)</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateAfterSorting</span><span style="color: #007700">.</span><span style="color: #DD0000">'")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.fn.yiiGridView.update(grid_id);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;("'</span><span style="color: #007700">.(string)</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">successMessage</span><span style="color: #007700">.</span><span style="color: #DD0000">'")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert('</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">successMessage</span><span style="color: #007700">).</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'error'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'js:function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(grid_selector).removeClass('</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">loadingCssClass</span><span style="color: #007700">).</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert('</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errorMessage</span><span style="color: #007700">).</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.fn.yiiGridView.update(grid_id);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">)).</span><span style="color: #DD0000">'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;}</span>
</span>
</code></div>
</div>

<p>Returns the javascript code responsable of handling the drag and drop sorting through an Ajax request</p>


<div class="detailHeader" id="init-detail">
init()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>init</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/laMarciana/yiiSortableModel/blob/master/widgets/SortableCGridView.php#L81">extensions//widgets/SortableCGridView.php#L81</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">init</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableDragDropSorting&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*To&nbsp;use&nbsp;this&nbsp;widget,&nbsp;data&nbsp;provider&nbsp;must&nbsp;be&nbsp;an&nbsp;instance&nbsp;of&nbsp;CActiveDataProvider*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(!(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider&nbsp;</span><span style="color: #007700">instanceof&nbsp;</span><span style="color: #0000BB">CActiveDataProvider</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">CException</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'Data&nbsp;provider&nbsp;must&nbsp;be&nbsp;an&nbsp;instance&nbsp;of&nbsp;CActiveDataProvider'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">allItemsInOnePage&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pagination&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableSorting&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">descSort&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sort_direction&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'ASC'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sort_direction&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'DESC'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setSort</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'defaultOrder'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'`'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">orderField</span><span style="color: #007700">.</span><span style="color: #DD0000">'`'</span><span style="color: #007700">.</span><span style="color: #0000BB">$sort_direction</span><span style="color: #007700">));<br />&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">init</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;}</span>
</span>
</code></div>
</div>

<p>Initializes the grid view.
This method will initialize required property values and instantiate <a href="SortableCGridView.html#columns">columns</a> objects.</p>


<div class="detailHeader" id="registerClientScript-detail">
registerClientScript()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>registerClientScript</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/laMarciana/yiiSortableModel/blob/master/widgets/SortableCGridView.php#L196">extensions//widgets/SortableCGridView.php#L196</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//Call&nbsp;parent<br />&nbsp;&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">();<br />&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableDragDropSorting&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//Register&nbsp;jquery-ui<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerCoreScript</span><span style="color: #007700">(</span><span style="color: #DD0000">'jquery.ui'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//Register&nbsp;sort&nbsp;script<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerScript</span><span style="color: #007700">(</span><span style="color: #0000BB">__CLASS__</span><span style="color: #007700">.</span><span style="color: #DD0000">'-'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*Call&nbsp;sort&nbsp;script&nbsp;when&nbsp;document&nbsp;is&nbsp;ready&nbsp;and&nbsp;each&nbsp;time&nbsp;grid&nbsp;is&nbsp;updated*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getSortScript</span><span style="color: #007700">().</span><span style="color: #DD0000">'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$("body").ajaxSuccess(function(e,&nbsp;xhr,&nbsp;settings)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(settings.url&nbsp;===&nbsp;$.fn.yiiGridView.getUrl('</span><span style="color: #007700">.</span><span style="color: #0000BB">Cjavascript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">()).</span><span style="color: #DD0000">'))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getSortScript</span><span style="color: #007700">().</span><span style="color: #DD0000">'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;'</span><span style="color: #007700">);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}</span>
</span>
</code></div>
</div>

<p>Registers necessary client scripts.</p>


<div class="detailHeader" id="renderTableRow-detail">
renderTableRow()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderTableRow</b>(integer $row)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$row</td>
  <td class="paramTypeCol">integer</td>
  <td class="paramDescCol">the row number (zero-based).</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/laMarciana/yiiSortableModel/blob/master/widgets/SortableCGridView.php#L107">extensions//widgets/SortableCGridView.php#L107</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB">&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderTableRow</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data</span><span style="color: #007700">[</span><span style="color: #0000BB">$row</span><span style="color: #007700">];<br />&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&lt;tr'</span><span style="color: #007700">;<br />&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClassExpression&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&nbsp;class="'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">evaluateExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClassExpression</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'row'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #DD0000">'data'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$data</span><span style="color: #007700">)).</span><span style="color: #DD0000">'"'</span><span style="color: #007700">;<br />&nbsp;&nbsp;}&nbsp;else&nbsp;if(</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClass</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$n</span><span style="color: #007700">=</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClass</span><span style="color: #007700">))&gt;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&nbsp;class="'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClass</span><span style="color: #007700">[</span><span style="color: #0000BB">$row</span><span style="color: #007700">%</span><span style="color: #0000BB">$n</span><span style="color: #007700">].</span><span style="color: #DD0000">'"'</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;</span><span style="color: #FF8000">/*Render&nbsp;the&nbsp;record&nbsp;id&nbsp;as&nbsp;its&nbsp;'data-id'&nbsp;atribute.&nbsp;This&nbsp;information&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;sort*/<br />&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableDragDropSorting&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&nbsp;data-id="'</span><span style="color: #007700">.</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">value</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">idField</span><span style="color: #007700">).</span><span style="color: #DD0000">'"'</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderDataCell</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;}</span>
</span>
</code></div>
</div>

<p>Renders a table body row.</p>


</div><!-- end of content -->

<div id="apiFooter">
Copyright &copy; 2008-2011 by <a href="http://www.yiisoft.com">Yii Software LLC</a><br/>
All Rights Reserved.<br/>
</div><!-- end of footer -->

<script type="text/javascript">
/*<![CDATA[*/
$("a.toggle").toggle(function(){
	$(this).text($(this).text().replace(/Hide/,'Show'));
	$(this).parents(".summary").find(".inherited").hide();
},function(){
	$(this).text($(this).text().replace(/Show/,'Hide'));
	$(this).parents(".summary").find(".inherited").show();
});
$(".sourceCode a.show").toggle(function(){
	$(this).text($(this).text().replace(/show/,'hide'));
	$(this).parents(".sourceCode").find("div.code").show();
},function(){
	$(this).text($(this).text().replace(/hide/,'show'));
	$(this).parents(".sourceCode").find("div.code").hide();
});
$("a.sourceLink").click(function(){
	$(this).attr('target','_blank');
});
/*]]>*/
</script>

</div><!-- end of page -->
</body>
</html>
